import request from '@/common/request.js'

const formDataHeader = { header: { 'content-type': 'application/json' } }
const attachmentType = { responseType: 'arraybuffer' }

export const psdlogin = function (data) {
  return request.post('/api/user/login', data, formDataHeader)
}

export const getSvg = function () {
  return request.get('/api/user/img/code', attachmentType)
}

export const getSmsCode = function (data, cookie) {
  return request.post('/api/user/sendSms', data, {
    header: {
      img_code_key: cookie
    }
  })
}

export const wxLogin = function (data) {
  return request.post('/frontApi/user/wxLogin', data)
}

export const getList = params => request.get('/m1/1627707-0-default/page', { params })
